import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/subwayst/swStPlanWeek/page/'+query.planType,
    method: 'get',
    params: query
  })
}

export function fetchListes(planType,query) {
  return request({
    url: '/subwayst/swStPlanWeek/pages/'+planType,
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/subwayst/swStPlanWeek/',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/subwayst/swStPlanWeek/' + id,
    method: 'get'
  })
}

export function delObj(row) {
  return request({
    url: '/subwayst/swStPlanWeek/' + row.id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/subwayst/swStPlanWeek/',
    method: 'put',
    data: obj
  })
}

export function addList(list) {
  return request({
    url: '/subwayst/swStPlanWeek/saveAll',
    method: 'post',
    data: list
  })
}
export function decompose(id, obj) {
  return request({
    url: `/subwayst/swStPlanWeek/${id}/decompose`,
    method: 'put',
    data: obj
  })
}

export function updateDecompose(id, obj) {
  return request({
    url: `/subwayst/swStPlanWeek/${id}/updateDecompose`,
    method: 'put',
    data: obj
  })
}

export function submit(obj) {
  return request({
    url: '/subwayst/swStPlanWeek/submit',
    method: 'put',
    data: obj
  })
}

export function auditObj(obj) {
  return request({
    url: '/subwayst/swStPlanWeek/audit',
    method: 'put',
    data: obj
  })
}

export function exportExcel(query) {
  return request({
    url: '/subwayst/swStPlanWeek/export',
    method: 'get',
    responseType:'blob',
    params: query
  })
}



